import React from 'react'
import classNames from 'classnames'
import './style.scss'

function Dialog(props: IUdDialogProps) {
  return (
    <div className="speekBox">
      <div>
        {props.value?.map((item, index) => {
          return (
            <div className="talckbox" key={index}>
              <div className={classNames(['msg-time', item.type == 1 ? 'leftTime' : 'rightTime'])}>{item.sendName}  {item.createdTime}</div>
              <div className={classNames(['msg-content', item.type == 1 ? 'leftText' : 'rightText'])}>{item.message}</div>
              {(item.status == 1 && item.type != 1) && <div className={item.status == 1 ? 'rightsee' : ''}>已读</div>}
            </div>
          )
        })}
      </div>
    </div>
  )
}

export default React.memo(Dialog)

interface IUdDialogProps {
  value: any
}
